﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MCSFramework.BLL;
using MCSFramework.SQLDAL.CM;
using MCSFramework.Model.CM;
using System.Data;

namespace MCSFramework.BLL.CM
{
    public class CM_ClientBLL : BaseSimpleBll<CM_Client>
    {
        private static string DALClassName = "MCSFramework.SQLDAL.CM.CM_ClientDAL";
        private CM_ClientDAL _dal;

        #region 构造函数，参数只有int而无guid是因为数据库表中的主键未int，code虽然也可以标志唯一但并非主键，用int类型的主键即可获取到数据库实例
        public CM_ClientBLL()
            : base(DALClassName)
        {
            _dal = (CM_ClientDAL)_DAL;
            _m = new CM_Client();//新建一个空类
        }

        public CM_ClientBLL(int id)
            : base(DALClassName)
        {
            _dal = (CM_ClientDAL)_DAL;
            FillModel(id);//获取当前类的数据库实例
        }

        public CM_ClientBLL(int id, bool bycache)
            : base(DALClassName)
        {
            _dal = (CM_ClientDAL)_DAL;
            FillModel(id, bycache);
        }
        #endregion

        #region 静态GetModelList方法
        public static IList<CM_Client> GetModelList(string condition)
        {
            return new CM_ClientBLL()._GetModelList(condition);
        }
        #endregion

        public DataTable GetFnaTable(int AccountMonth, int OrganizeCity, int State, int Staff, int RTChannel, int RTType)
        {
            return _dal.GetFnaTable(AccountMonth, OrganizeCity, State, Staff, RTChannel, RTType);
        }
    }
}
